package com.zn.opit.miniodemo.exception;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@Setter
@Getter
public class ExtException extends RuntimeException {

    protected String code;  // 异常对应的返回码
    protected String msg;   // 异常对应的描述信息
    protected Object data;  // 异常对应的异常数据

    protected ExtException(String msg) {
        super(msg);
        msg = msg;
    }

    protected ExtException(String code, String massage) {
        this.code = code;
        this.msg = massage;
    }

    protected ExtException(ExtExceptionInfo exceptionInfo) {
        this.code = exceptionInfo.getCode();
        this.msg = exceptionInfo.getMsg();
    }
}
